package com.didi.gulimall.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 10626
 */
@Configuration
public class MyMQConfig {

    @Bean
    public Queue orderReleaseWareQueue() {
        return new Queue("order.release.ware.queue", true, false, false);
    }

    @Bean
    public Binding orderReleaseWareBinding() {
        return new Binding("order.release.ware.queue",
                Binding.DestinationType.QUEUE,
                "order-event-exchange",
                "order.release.#",
                null);
    }

    @Bean
    public Queue orderPaySuccessWareQueue() {
        return new Queue("order.paysuccess.ware.queue", true, false, false);
    }

    @Bean
    public Binding orderPaySuccessWareBinding() {
        return new Binding("order.paysuccess.ware.queue",
                Binding.DestinationType.QUEUE,
                "order-event-exchange",
                "order.paysuccess.#",
                null);
    }

}
